package com.netease.pris.c;

import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.text.TextUtils;
import com.netease.pris.provider.k;

public class d
{
  static String[] a;
  public static final int b = 0;
  public static final int c = 1;
  public static final int d = 2;
  public static final int e = 3;
  public static final int f = 4;

  static
  {
    String[] arrayOfString = new String[5];
    arrayOfString[0] = "_id";
    arrayOfString[1] = "account";
    arrayOfString[2] = "timestamp";
    arrayOfString[3] = "content";
    arrayOfString[4] = "other";
    a = arrayOfString;
  }

  public static Cursor a(Context paramContext, String paramString)
  {
    Cursor localCursor = null;
    if ((paramContext == null) || (TextUtils.isEmpty(paramString)));
    while (true)
    {
      return localCursor;
      String str = "account = '" + paramString + "'";
      localCursor = paramContext.getContentResolver().query(k.b, a, str, null, " timestamp ASC");
    }
  }

  public static void a(Context paramContext, String paramString1, String paramString2)
  {
    if ((paramContext == null) || (TextUtils.isEmpty(paramString1)) || (TextUtils.isEmpty(paramString2)));
    while (true)
    {
      return;
      ContentValues localContentValues = new ContentValues();
      localContentValues.put("account", paramString1);
      localContentValues.put("content", paramString2);
      localContentValues.put("timestamp", Long.valueOf(System.currentTimeMillis()));
      paramContext.getContentResolver().insert(k.b, localContentValues);
      b(paramContext, paramString1);
    }
  }

  public static Cursor b(Context paramContext, String paramString1, String paramString2)
  {
    Cursor localCursor = null;
    if ((paramContext == null) || (TextUtils.isEmpty(paramString1)));
    while (true)
    {
      return localCursor;
      String str = "account = '" + paramString1 + "'" + " AND " + "content" + " like '%" + paramString2 + "%'";
      localCursor = paramContext.getContentResolver().query(k.b, a, str, null, " timestamp ASC");
    }
  }

  public static void b(Context paramContext, String paramString)
  {
    Cursor localCursor = a(paramContext, paramString);
    if (localCursor == null);
    while (true)
    {
      return;
      int i = 0;
      System.currentTimeMillis();
      int j = localCursor.getCount();
      if (j > 50)
      {
        localCursor.moveToFirst();
        long l;
        do
        {
          i++;
          l = localCursor.getLong(2);
        }
        while (j - 50 > i);
        localCursor.close();
        String str = "_id in ( select _id from search where timestamp < " + l + ")";
        paramContext.getContentResolver().delete(k.b, str, null);
        continue;
      }
      localCursor.close();
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.c.d
 * JD-Core Version:    0.6.0
 */